package Test;


import org.zeromq.ZMQ;

public class JeroReq {
    public static void main(String[] args) {
        //创建zmp客户端
        ZMQ.Context zmq = ZMQ.context(1);

        //创建问答模式中的问的客户端
        ZMQ.Socket req = zmq.socket(ZMQ.REQ);

        req.connect("tcp://localhost:5555");


        while (!Thread.currentThread().isInterrupted()){
            String str = "hello world";

            System.out.println(str);

            req.send(str);

            byte[] recv = req.recv();
            System.out.println(new String(recv));
        }

        req.close();

        zmq.close();





    }
}
